package cn.yitun.chat.yitunserverimbase.dao.userchat;

import cn.yitun.chat.yitunservercommonlib.crud.yitun.CrudDao;
import cn.yitun.chat.yitunservercommonlib.dataentity.dto.userchat.UserHeadDto;
import cn.yitun.chat.yitunservercommonlib.dataentity.po.userchat.UserHeadInfo;
import cn.yitun.chat.yitunservercommonlib.dataentity.vo.userchat.UserHeadVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 用户头表
 * @author chenyitun
 * @email chenyitun@163.com
 * @date 2020-05-27 14:44:44
 */
@Mapper
public interface UserHeadDao extends CrudDao<UserHeadDto, UserHeadInfo, UserHeadVo> {

	int absDel(Long id);

	int batchAbsDel(Long[] ids);

	/**
	 * 获取头
	 * @param userId
	 * @param headId
	 * @param type
	 * @return
	 */
	UserHeadVo getBy(@Param("userId") Long userId,
				   @Param("headId")Long headId,
				   @Param("type")String type);

	/**
	 * 获取最近的头
	 * @param userId
	 * @return
	 */
	UserHeadVo getLastByUserId(@Param("userId") Long userId);

	/**
	 * 获取好友的头像
	 * @param userId
	 * @return
	 */
	List<UserHeadVo> getUserCategoryMemberUserHeadListByUserId(@Param("userId") Long userId);

	/**
	 * 获取头像
	 * @param ids
	 * @return
	 */
	List<UserHeadVo> getUserHeadListByUserIds(@Param("list") List<Long> ids);

	/**
	 * 删除
	 * @param userId
	 */
    int removeByUserId(@Param("userId") Long userId);
}
